﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentValidation;
using NursingHome.Model.Validators.CustomValidators;

namespace NursingHome.Model.Validators
{
    public class PatientValidator: AbstractValidator<Patient>
    {
        public PatientValidator()
        {
            RuleFor(p => p.Name).NotEmpty().Length(0, 50).WithMessage("Name should not be more than 50 characters.");
            RuleFor(p => p.DOB).SetValidator(new DateValidator()).WithName("Date of birth");
        }
    }
}
